package com.zbs.framework.pay.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "pay.alipay")
public class AliPayConfig {
    //支付宝 appid
    public static String appId;
    //公司支付宝私钥
    public static String merchantPrivateKey;
    //公司支付宝公钥
    public static String alipayPublicKey;
    //公司支付宝私钥路径
    public static String merchantPrivateKeyPath;
    //公司支付宝公钥路径
    public static String alipayPublicKeyPath;
    //公司支付宝异步回调地址
    public static String notifyUrl;
    //公司支付宝同步回调地址
    public static String returnUrl;
    //加密方式
    public static String signType = "RSA2";
    //支付宝网关
    public static String gatewayUrl;
    // 可设置AES密钥，调用AES加解密相关接口时需要（可选）
    public static String encryptKey;
    // 订单超时时间
    public static Integer express;

    public void setAppId(String appId) {
        AliPayConfig.appId = appId;
    }

    public void setMerchantPrivateKey(String merchantPrivateKey) {
        AliPayConfig.merchantPrivateKey = merchantPrivateKey;
    }

    public void setAlipayPublicKey(String alipayPublicKey) {
        AliPayConfig.alipayPublicKey = alipayPublicKey;
    }

    public void setNotifyUrl(String notifyUrl) {
        AliPayConfig.notifyUrl = notifyUrl;
    }

    public void setReturnUrl(String returnUrl) {
        AliPayConfig.returnUrl = returnUrl;
    }

    public void setSignType(String signType) {
        AliPayConfig.signType = signType;
    }

    public void setGatewayUrl(String gatewayUrl) {
        AliPayConfig.gatewayUrl = gatewayUrl;
    }

    public void setEncryptKey(String encryptKey) {
        AliPayConfig.encryptKey = encryptKey;
    }

    public void setMerchantPrivateKeyPath(String merchantPrivateKeyPath) {
        AliPayConfig.merchantPrivateKeyPath = merchantPrivateKeyPath;
    }

    public void setAlipayPublicKeyPath(String alipayPublicKeyPath) {
        AliPayConfig.alipayPublicKeyPath = alipayPublicKeyPath;
    }

    public void setExpress(Integer express) {
        AliPayConfig.express = express;
    }
}
